<!--
 * @FilePath     : /jquery/demo/101-8.html
 * @Description  : 序列 表单内容为 数组，用于 AJAX 请求
 * @Date         : 2025-03-20 20:52
 * @Author       : Fang YingGui
 * @LastEditors  : fangyinggui 18715384437@163.com
 * @LastEditTime : 2025-03-20 20:53
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>documentName</title>
    <link rel="stylesheet" href="" />
  </head>
  <body>
    <h2>序列下面内容</h2>

    <p id="results"><b>Results:</b></p>
    <form>
      <select name="single">
        <option>Single</option>
        <option>Single2</option>
      </select>
      <select name="multiple" multiple="multiple">
        <option selected="selected">Multiple</option>
        <option>Multiple2</option>
        <option selected="selected">Multiple3</option>
      </select>
      <br />
      <input type="checkbox" name="check" value="check1" />
      check1
      <input type="checkbox" name="check" value="check2" checked="checked" />
      check2
      <input type="radio" name="radio" value="radio1" checked="checked" />
      radio1
      <input type="radio" name="radio" value="radio2" />
      radio2
    </form>

    <script src="/library/jquery.min.js"></script>
    <script src="/common/common.js"></script>
    <script>
      console.log($('form').serializeArray())
      /*
      [
        0: {name: 'single', value: 'Single'}
        1: {name: 'multiple', value: 'Multiple'}
        2: {name: 'multiple', value: 'Multiple3'}
        3: {name: 'check', value: 'check2'}
        4: {name: 'radio', value: 'radio1'}
      ]
      */
    </script>
  </body>
</html>
